// base
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
// less
import './index.less'

class EducationCard extends Component {
  static defaultProps = {
    dataSource: []
  }
  componentWillMount () {
    // onLoad
  }

  componentDidMount () {
    // onready
  }

  componentDidShow () {
    // onshow
  }

  componentWillUnmount () {
    // onUnload
  }

  componentWillReceiveProps (nextprops) {}

  jumpTo = id => {
    this.props.onTap(id)
  }
  render () {
    const { dataSource = {} } = this.props
    const { degreeLevel = [], course = '' } = dataSource
    return (
      <View className="EducationCard_id53089" onClick={this.jumpTo.bind(this, dataSource.id)}>
        <View className="card-top">
          <View className="date">{dataSource.time}</View>
          <View className="degree">{degreeLevel[course - 1].name}</View>
        </View>
        <View className="card-content">
          <View className="collage">{dataSource.schoolname}</View>
          <View className="line-content">
            <View className="left-dot" />
            <View className="line" />
          </View>
          <View className="major">
            {dataSource.professional}
          </View>
        </View>
      </View>
    )
  }
}

export default EducationCard
